package com.upstream.link.model
{
	import com.upstream.link.SYS;
	import com.upstream.link.view.RectVO;
	
	import flash.geom.Point;

	public class GameModel
	{
		public var rectVoVect:Array;
		private static var _instance:GameModel;
		public function GameModel(p:Param)
		{
			this.rectVoVect = new Array();
			initData();
		}
		
		public static function getInstance():GameModel{
			if(!_instance){
				_instance = new GameModel(new Param());
			}
			return _instance;
		}
		
		private function initData():void{
			for(var i:int=0;i<SYS.ITEM_Y_NUM;i++){
				var tmpVect:Array = new Array();
				var arr:Array = [];
				for(var j:int=0;j<SYS.ITEM_X_NUM;j++){
					var type:int = int(Math.random() * 5) +1;
					if(i==0 || i==(SYS.ITEM_Y_NUM-1) || j==0 || j==(SYS.ITEM_X_NUM-1)) type=0;
					var rectVo:RectVO = new RectVO();
					rectVo.type = type;
					arr.push(type);
					rectVo.p = new Point(j,i);
					tmpVect.push(rectVo);
				}
				trace(arr.toString());
				this.rectVoVect.push(tmpVect);
			}
		}
	}
}
class Param{}